//Pelangi dimatamu ^_^

(function () {
  var angle = 0;
  var p = document.querySelector('p');
  var text = p.textContent.split('');
  var len = text.length;
  var phaseJump = 360 / len;
  var spans;

  p.innerHTML = text.map(function (char) {
    return '<span>' + char + '</span>';
  }).join('');

  spans = p.children;
  console.log(spans[0], spans[len - 1]);
  (function wheee () {
    for (var i = 0; i < len; i++) {
      console.log(angle + Math.floor(i * phaseJump));
      spans[i].style.color = 'hsl(' + (angle + Math.floor(i * phaseJump)) + ', 55%, 70%)';
    }
    angle++;
    requestAnimationFrame(wheee);
  })();
})();
